<?
$media = $args['media'];
$title = $media->getTitle();
$type = $media->getType();

if ($type == 'image') {
	$filename = SITE_WEB_DIRECTORY . MEDIA_BASE_DIRECTORY . '/' . $media->getAreaID() . '/' . $media->getFileName();
	$output = "<img src=\"{$filename}\" />";
} else {
	$output = '<a href="' . $media->getFileURL() . '">Click here to download the file</a>.';
}

$media_prev = $args['prev'];
$media_next = $args['next'];

if (isset($media_prev)) {
	$url_prev = ((USE_MOD_REWRITE) ? SITE_WEB_DIRECTORY . "/gm/" : SITE_WEB_DIRECTORY . "/media.php") . "?id=" . $media_prev->getAreaID() . "&media_instance_id=" . $media_prev->getID();
}

if (isset($media_next)) {
	$url_next = ((USE_MOD_REWRITE) ? SITE_WEB_DIRECTORY . "/gm/" : SITE_WEB_DIRECTORY . "/media.php") . "?id=" . $media_next->getAreaID() . "&media_instance_id=" . $media_next->getID();
}

$description = $media->getDescription();
$exitURL = SITE_WEB_DIRECTORY . $args['exitURL'];
?>
